﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteSearch.Master" AutoEventWireup="true"
    CodeBehind="CatDoctores.aspx.cs" Inherits="CLab.PagAdminLab.CatDoctores" %>

<%@ MasterType VirtualPath="~/SiteSearch.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src='<%=ResolveUrl("../Scripts/CatDoctores.js")%>'></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphFilter" runat="server">
    <table>
        <tr>
            <td class="tdEtiqueta">
                Nombre:
            </td>
            <td class="tdCampo">
                <ganda:TextBox ID="txtNombre" runat="server" Width="200px" MaxLength="200" TabIndex="0" />
            </td>
        </tr>
    </table>
    <div class="btnBusar">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="BtnBuscar" runat="server" Text="Buscar" CssClass="boton" OnClick="BtnBuscar_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphContent" runat="server">
    <div class="toolBarAcciones">
        <asp:Button ID="btnAgregar" runat="server" Text="Agregar" OnClick="btnAgregar_Click" CssClass="boton" />&nbsp;
        <asp:Button ID="btnExportar" runat="server" Text="Exportar" OnClick="btnExportar_Click" CssClass="boton" />
    </div>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <ganda:GridView ID="gridDoctores" runat="server" AutoGenerateColumns="False" DataKeyNames="IdDoctor"
               AllowPaging="True" onrowcommand="gridDoctores_RowCommand" AllowScroll="true" OnPageIndexChanging="gridDoctores_PageIndexChanging">
                <PagerSettings Mode="NextPreviousFirstLast" Position="Top"/>
                <Columns>
                    <asp:BoundField DataField="IdLaboratorio" HeaderText="IdLaboratorio" SortExpression="IdLaboratorio" Visible="false">
                    </asp:BoundField>
                    <asp:BoundField DataField="IdDoctor" HeaderText="Id" SortExpression="IdDoctor" ItemStyle-Width="100px">
                        <ItemStyle Width="100px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Nombre" HeaderText="Nombre" SortExpression="Nombre" ItemStyle-Width="300px">
                        <ItemStyle Width="300px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Direccion" HeaderText="Dirección" SortExpression="Direccion" ItemStyle-Width="200px" />
                    <asp:BoundField DataField="Telefono" HeaderText="Telefono" SortExpression="Telefono" ItemStyle-Width="100px"/>
                    <asp:BoundField DataField="UserName" HeaderText="Usuario" SortExpression="UserName" ItemStyle-Width="100px" />
                    <asp:TemplateField HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:Button ID="BtnMod" CssClass="btnMod" runat="server" Text="" CommandName="cmdModificar" CommandArgument='<%#Eval("IdDoctor") + "," + Container.DataItemIndex %>' />
                            <ganda:Button ID="BtnDel" CssClass="btnDel" runat="server" Text="" Params='<%#Eval("IdDoctor") + "," + Container.DataItemIndex %>'  OnClientClick="return Elimina(this);" />
                        </ItemTemplate>
                        <ItemStyle Width="100px" />
                    </asp:TemplateField>
                </Columns>
            </ganda:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnExportar" />
        </Triggers>
    </asp:UpdatePanel>
    <div style="display: none;">
        <asp:UpdatePanel runat="server" ID="updhidden">
            <ContentTemplate>
                <asp:HiddenField ID="hdnId" runat="server" />
                <asp:Button ID="btnElimina" runat="server" OnClick="btnElimina_Click" CausesValidation="false" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <script type="text/javascript">
        var txtNombre = "<%=txtNombre.ControlTextBox.ClientID %>";
        var hdnId = "<%=hdnId.ClientID %>";
        var btnElimina = "<%=btnElimina.ClientID %>";
        var btnAgregar = "<%=btnAgregar.ClientID %>";
        var btnExportar = '<%=btnExportar.ClientID %>'
        var btnBuscar = '<%=BtnBuscar.ClientID %>';
    </script>
</asp:Content>
